<?
define('IN_LC', true);
define('MM_ID', 0);

include_once('../validate.php');

if(isset($_GET['id']) && is_numeric($_GET['id']))
{
	$key = 'faq_useful_' . $_GET['id'];
	if(! isset($_SESSION[$key]))
	{
		$q = 'UPDATE ' . FAQS_TABLE . ' SET fq_useful = fq_useful + 1 WHERE fq_id = ' . $_GET['id'];
		$db->sql_query($q);
		
		$q = 'SELECT fq_useful FROM ' . FAQS_TABLE . ' WHERE fq_id = ' . $_GET['id'];
		$res = $db->sql_query($q);
		if ( $row = $db->sql_fetchrow($res)  )
		{
			echo $row['fq_useful'] . ' ' . $lang['FAQUsefulInfo'];
			$_SESSION[$key] = '1';	
		}
		else
		{
			echo "#NO_SHOW"; //Tell output not to update
		}
	}
	else
	{
		echo "#NO_SHOW"; //Tell output not to update
	}
}

?>